﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;

namespace MyMovieInfo
{
    //Creating this class as per SRP, OCP and ISP        
    class SerializationService
    {        
        public static void PersistDataXML<T>(T list, string theFileName)
        {
            //TODO: Get the pictures
            XmlSerializer xmlserializer = new XmlSerializer(typeof(T));
            using (StreamWriter streamwriter = new StreamWriter(theFileName))
            {
                xmlserializer.Serialize(streamwriter, list);
                streamwriter.Close();
            }
        }

    }
}